-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Limit number of images uploaded at a time #3124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Limit number of images uploaded at a time #3124
Conversation
…load at once UploadMediaDetailFragment : changed next button onclick function to handle too many images. (View pager will not allowed to go to category fragment if there are too many images) added update UI process to a seprate function to handle fragment reload after an image is deleted. added too_many_images static flag
…pager UploadPresentere.java : reoved hide top card if delete index is last image as if last image is deleted then the new last image will be displayed UploadMediaDetailFragment.java : improved existing code
…ard which indicates whether there are images more than 5 images. This icon will be visible if there are more than 5 images and gone when user removes images left less than or equal to 5. activity_upload.xml : added error icon to top card to indicate user there is an error (In this case there are more than 5 images in the selection)
…g the last image, the current selected position should be decremented. Added comments where needed.
…st image fragment as soon as to gray if there are too many images. implemented Toast of too many images using ViewUtil UploadActivity.java : implemented top card error icon onClick function to show alert dialog UploadPresenter.java : moved maximum no of images allowed static variable from UploadActivity strings.xml : added string values for too many images alert box title and message and toast message
…on and error icon Icon Files : new image remove icon item_upload_thumbnail.xml : small changes to UI to position remove icon correctly in right upper corner of the thumbnail
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add tests to make sure this change works as expected?
All the new functions are in view layer. Therefore no new unit tests have been written as mentioned in the description . |
@ilgazer @maskaravivek Would be great if someone could review this code and provide feedback. |
This PR is old and has several conflicts. On the other hand, the code does the job. @harith96 thanks a lot for this PR, are you interested to fix conflicts? If not other volunteers are encouraged to claim this PR and solve it by inspiration from this code:) |
Closing since this PR seems like sleeping. I noted that this code can be revisited to inspire from under issue page. |
Images that can be uploaded at a time has to be limited (current max. number : 5) to avoid the issue of users uploading a lot of unnecessary images.
Fixes ##3101 Limit on number of images uploaded at once
Changes
As the number of images selected at a time cannot be limited in Android Image Picker and to avoid redundant code the functionality of removing images was integrated into the existing image upload flow.
Each thumbnail of top card has a close button and users can delete a image using that button at any time during upload process.
If user has selected too many images an error icon will be displayed next to the top card title and an dialog will be displayed if user clicks the error icon mentioning the
max. number of images allowed and min. number of images that have to be deleted. And also user will not be able to progress to select the category until there are only max. number of images in the selection. (The next button on the last image fragment will be disabled and a toast will be displayed if user clicks next button on the last image fragment.)
Tests - no new unit tests were written as all the new function were written in UploadActivity class and ThumbnailsAdapter class related to the UI.
Screenshots showing what changed (optional - for UI changes)